package SeedBank

import java.util.Date;

/**
 * Represents a purchase and specifies the properties of each purchase
 * 
 * @author Nathan
 *
 */
class Purchase {

	
		static constraints = {
		}
		
		static belongsTo = [user:User]
		String scientificName
		int quantity
		int price
		Date endOfGrowingSeason
		Date startOfGrowingSeason
		String harvestingInformation
		String specialRequirements
		int hardinessZone
		String commonName
		Date lastUpdated
		Date dateCreated
		
		
		//date created
		
		/**
		 * Overrides the toString method and specifies how a purchase 
		 * should be represented in string
		 * 
		 * @return the string representation
		 */
		String toString(){
			return "${commonName}, ${scientificName} (${quantity})"
		}
	
	
}
